import { _decorator, Component, director, EventTouch, Node, v2, v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TouchPanel')
export class TouchPanel extends Component {

    protected onLoad(): void {

        this.node.on(Node.EventType.TOUCH_START, this.onTouchStart, this);
    }

    onTouchStart(e: EventTouch) {
        e.getUILocation(tmpP2);
        const wpos = this.node.worldPosition;
        tmpP2.subtract2f(wpos.x, wpos.y);

        director.emit('showDiffuseEffect1', tmpP3.set(tmpP2.x, tmpP2.y));
    }

}
const tmpP2 = v2();
const tmpP3 = v3();


